<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	template="/layout/page/search/custom-search-template.xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:sinox="http://www.sinosoft.com.cn/sinox"
	xmlns:p="http://primefaces.org/ui">
 
    <ui:param name="compId" value="#{commonContentViewBean.id}" />
	<ui:param name="compBean" value="#{commonContentViewBean}" />
	<ui:param name="compTitle" value="消息管理查询" />
	
	<ui:define name="compButtons">
		<p:commandButton update="main-tabSet:#{compId}_form:#{compId}_table"
		    title="查询" value="查询" styleClass="portal-toolbar-button" 
		    actionListener="#{commonContentViewBean.activeSearch}" >  
		    <h:inputHidden value="#{commonContentViewBean.id}"/>
	    </p:commandButton>
		<p:commandButton title="新建" value="新建" styleClass="portal-toolbar-button"
		    onstart="btnAction('#{commonContentViewBean.id}','v3.manage.role.roleLayout.add','800','450','icons/cog_add.png','add','msg-manage-scene','msg-add');"
			onclick="" />  
		<p:commandButton title="导出" value="导出" styleClass="portal-toolbar-button" >  
	    </p:commandButton>
		<p:commandButton title="重置" value="重置" styleClass="portal-toolbar-button" 
			onclick="" />
	</ui:define>
	<ui:define name="compContent">
	
		<ui:decorate template="/layout/input/editable-template.xhtml">
			 
			
			<!-- 第一行 -->
			<ui:decorate template="/layout/input/editable-2c-custom-template.xhtml">
				<ui:param name="compBean1Id" value="informationsendd" />
				<ui:param name="compBean1Lable" value="发送人单位" />
				
				<ui:define name="compBean1Content">
					<sinox:inputText id="#{compBean1Id}" value="#{compBean.a}" />
				</ui:define>
				
				<ui:param name="compBean2Id" value="informationreceived" />
				<ui:param name="compBean2Lable" value="接收人单位" />
				
				<ui:define name="compBean2Content">
					<sinox:inputText id="#{compBean2Id}" value="#{compBean.b}" />
				</ui:define>
			</ui:decorate>
			
			<!-- 第二行 -->
			<ui:decorate template="/layout/input/editable-2c-custom-template.xhtml">
				<ui:param name="compBean1Id" value="informationsender" />
				<ui:param name="compBean1Lable" value="发送人" />
				<ui:define name="compBean1Content">
					<sinox:inputText id="#{compBean1Id}" value="#{compBean.c}" />
				</ui:define>
				
				<ui:param name="compBean2Id" value="informationreceiver" />
				<ui:param name="compBean2Lable" value="接收人" />
				
				<ui:define name="compBean2Content">
					<sinox:inputText id="#{compBean2Id}" value="#{compBean.d}" />
				</ui:define>
			</ui:decorate>
			 
		</ui:decorate>
	
	</ui:define>
	
	<ui:define name="compData">
		  
		<p:dataTable id="#{compId}_table" var="patient" value="#{commonContentViewBean.lazyModel}" paginator="true"
			rows="#{commonContentViewBean.rowsNumber}" lazy="true" 
			emptyMessage="#{messages['portal.datatable.noRecordsFound']}"
			paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
	        rowsPerPageTemplate="#{commonContentViewBean.rowsNumberSelectItems}" 
	        selection="#{commonContentViewBean.selectRow}" selectionMode="single" paginatorPosition="bottom"> 
	   
	       <p:ajax event="rowSelect" oncomplete="#{compOnRowSelectComplete}" listener="#{commonContentViewBean.onRowSelect}" />
	  		
	        <c:forEach items="#{commonContentViewBean.header}" var="header" varStatus="stat">
	        	 
				<p:column style="width:#{header.width};" styleClass="#{header.alignStyle}">
					<f:facet name="header">
						<h:outputText value="#{header.label}" />
					</f:facet>
					<h:outputText value="#{patient.row[stat.index]}"/>
				</p:column>
					 
			</c:forEach>
			<p:column >  
			    <f:facet name="header">
					<h:outputText value="消息操作" />
				</f:facet>
	            <p:commandButton update="main-tabSet:#{compId}_form:#{compId}_table" 
	            onstart="btnAction('#{patient.row[5]}','v3.manage.role.roleLayout.add','1000','400','icons/cog_add.png','lookup','msg-manage-scene','msg-lookup');"
	                    image="ui-icon ui-icon-search" >    
	                   <h:inputHidden value="#{patient.row[5]}" /> 
	            </p:commandButton>  
	             <p:commandButton update="main-tabSet:#{compId}_form:#{compId}_table"
	            onstart="btnAction('#{patient.row[5]}','v3.manage.role.roleLayout.add','1000','400','icons/cog_add.png','edit','msg-manage-scene','msg-edit');"
	                    image="ui-icon ui-icon-wrench" >    
	                   <h:inputHidden value="#{patient.row[5]}" />
	            </p:commandButton>  
	             <p:commandButton update="main-tabSet:#{compId}_form:#{compId}_table" onstart="if(confirm('确认要删除吗？')){return true;}else{return false;}"
	                   actionListener="#{informationManageAction.delete}"  
	                   image="ui-icon ui-icon-trash" >    
	                   <h:inputHidden value="#{patient.row[5]}" />
	            </p:commandButton>  
	        </p:column> 
	    </p:dataTable>
	</ui:define>
		
</ui:composition>